home *** CD-ROM | disk | FTP | other *** search
/ Ultra Gameplayers 101 / Ultra Game Players Magazine, No. 101 - September 1997 (Imagine Publishing, Inc.)(1997).iso / pc / new_ugp.dxr / 00312_GenericClass.ls < prev    next >
Encoding:
Text File  |  1997-07-10  |  1.5 KB  |  68 lines

  1. property prefix, debug
  2.  
  3. on new me
  4.   set debug to 0
  5.   if debug >= 4 then
  6.     put EMPTY
  7.     put "New Object: GenericClass"
  8.   end if
  9.   return me
  10. end
  11.  
  12. on clearactorlist me, classname, whichprop
  13.   repeat with index = 1 to count(the actorList)
  14.     set obj to getAt(the actorList, index)
  15.     if getObjectName(obj) = classname then
  16.       if value("the " & string(whichprop) & " of obj") = value("the " & string(whichprop) & " of me") then
  17.         deleteAt(the actorList, index)
  18.         exit repeat
  19.       end if
  20.     end if
  21.   end repeat
  22. end
  23.  
  24. on getObjectName me
  25.   set oldDelimiter to the itemDelimiter
  26.   delpush(QUOTE)
  27.   set name to item 2 of string(me)
  28.   delpop()
  29.   return name
  30. end
  31.  
  32. on safestring me, whichstring
  33.   set pos to offset("'", whichstring)
  34.   repeat while pos > 0
  35.     put QUOTE into char pos of whichstring
  36.     set pos to offset("'", whichstring)
  37.   end repeat
  38.   set pos to offset(";", whichstring)
  39.   repeat while pos > 0
  40.     put RETURN into char pos of whichstring
  41.     set pos to offset(";", whichstring)
  42.   end repeat
  43.   return whichstring
  44. end
  45.  
  46. on showobject me
  47.   set curtext to the scriptText of member getObjectName(me)
  48.   repeat with index = 1 to the number of lines in curtext
  49.     set curline to line index of curtext
  50.     case word 1 of curline of
  51.       "on", "property":
  52.         put curline
  53.     end case
  54.   end repeat
  55. end
  56.  
  57. on TurnOn me
  58.   put "GenericClass TurnOn called!!"
  59. end
  60.  
  61. on TurnOff me
  62.   put "GenericClass TurnOff called!!"
  63. end
  64.  
  65. on dispose me, classname, whichprop
  66.   return 0
  67. end
  68.